<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:89:"D:\yinni\newwamp\wamp64\www\fire_lot\public/../application/admin\view\users\showuser.html";i:1505434732;s:81:"D:\yinni\newwamp\wamp64\www\fire_lot\public/../application/admin\view\layout.html";i:1505441464;}*/ ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>消防监测预警平台</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <!-- 	<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet" /> -->
    <link href="artisan_plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="artisan_plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="artisan_plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="artisan_css/animate.min.css" rel="stylesheet" />
    <link href="artisan_css/style.min.css" rel="stylesheet" />
    <link href="artisan_css/style-responsive.min.css" rel="stylesheet" />
    <link href="artisan_css/theme/red.css" rel="stylesheet" id="theme" />

    <!-- ================== END BASE CSS STYLE ================== -->
    <!-- ================== BEGIN PAGE CSS ================== -->
    <style type="text/css">
    .has-sub p{
        font-size: 15px;
    }
    .sub-menu a{
        font-size: 14px;
        font-weight: bold;
    }  
    .breadcrumb>li{
        font-size: 14px;
    } 
    .panel-heading .panel-title{
        font-size: 14px;
        font-weight: 12px;
    }     
    </style>
    
<!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
<link href="artisan_plugins/DataTables/css/data-table.css" rel="stylesheet"/>
<link href="artisan_plugins/switchery/switchery.min.css" rel="stylesheet"/>
<link href="artisan_plugins/powerange/powerange.min.css" rel="stylesheet"/>
<!-- ================== END PAGE LEVEL STYLE ================== -->
<style type="text/css">
    #data-table_paginate, #data-table_info {display: none;}
    td {font-size: 13px;}
</style>

    <!-- ================== END PAGE CSS ================== -->
</head>
<body>
<!-- begin #page-loader -->
<div id="page-loader" class="fade in"><span class="spinner"></span></div>
<!-- end #page-loader -->

<!-- begin #page-container -->
<div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
    <!-- begin #header -->
    <div id="header" class="header navbar navbar-default navbar-fixed-top">
        <!-- begin container-fluid -->
        <div class="container-fluid">
            <!-- begin mobile sidebar expand / collapse button -->
            <div class="navbar-header">
                <a href="<?php echo url('admin/Index/index'); ?>" class="navbar-brand"><span class="navbar-logo"></span> 消防监测预警平台</a>
                <button type="button" class="navbar-toggle" data-click="sidebar-toggled">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <!-- end mobile sidebar expand / collapse button -->

            <!-- begin header navigation right -->
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <form class="navbar-form full-width">
                        <div class="form-group">
                            <input type="text" class="form-control" placeholder="请输入关键字进行检索" />
                            <button type="submit" class="btn btn-search"><i class="fa fa-search"></i></button>
                        </div>
                    </form>
                </li>
                <li class="dropdown">
                    <a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle f-s-14">
                        <i class="fa fa-bell-o"></i>
                        <span class="label">5</span>
                    </a>
                    <ul class="dropdown-menu media-list pull-right animated fadeInDown">
                        <li class="dropdown-header">Notifications (5)</li>
                        <li class="media">
                            <a href="javascript:;">
                                <div class="media-left"><i class="fa fa-bug media-object bg-red"></i></div>
                                <div class="media-body">
                                    <h6 class="media-heading">Server Error Reports</h6>
                                    <div class="text-muted f-s-11">3 minutes ago</div>
                                </div>
                            </a>
                        </li>
                        <li class="media">
                            <a href="javascript:;">
                                <div class="media-left"><img src="artisan_img/user-12.jpg" class="media-object" alt="" /></div>
                                <div class="media-body">
                                    <h6 class="media-heading">John Smith</h6>
                                    <p>Quisque pulvinar tellus sit amet sem scelerisque tincidunt.</p>
                                    <div class="text-muted f-s-11">25 minutes ago</div>
                                </div>
                            </a>
                        </li>
                        <li class="media">
                            <a href="javascript:;">
                                <div class="media-left"><img src="artisan_img/user-12.jpg" class="media-object" alt="" /></div>
                                <div class="media-body">
                                    <h6 class="media-heading">Olivia</h6>
                                    <p>Quisque pulvinar tellus sit amet sem scelerisque tincidunt.</p>
                                    <div class="text-muted f-s-11">35 minutes ago</div>
                                </div>
                            </a>
                        </li>
                        <li class="media">
                            <a href="javascript:;">
                                <div class="media-left"><i class="fa fa-plus media-object bg-green"></i></div>
                                <div class="media-body">
                                    <h6 class="media-heading"> New User Registered</h6>
                                    <div class="text-muted f-s-11">1 hour ago</div>
                                </div>
                            </a>
                        </li>
                        <li class="media">
                            <a href="javascript:;">
                                <div class="media-left"><i class="fa fa-envelope media-object bg-blue"></i></div>
                                <div class="media-body">
                                    <h6 class="media-heading"> New Email From John</h6>
                                    <div class="text-muted f-s-11">2 hour ago</div>
                                </div>
                            </a>
                        </li>
                        <li class="dropdown-footer text-center">
                            <a href="javascript:;">View more</a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown navbar-user">
                    <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
                        <img src="artisan_img/user-12.jpg" alt="" />
                        <span class="hidden-xs"><?php echo \think\Session::get('userinfo')['username']; ?></span> <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu animated fadeInLeft">
                        <li class="arrow"></li>
                        <li><a href="<?php echo url('/Admin/Index/showuser',['id' => \think\Session::get('userinfo')['id']]); ?>" style="font-size: 14px;"><i class="fa fa-gear"></i> 查看信息</a></li>
                        <li><a href="<?php echo url('Admin/Login/logout'); ?>" style="font-size: 14px;"><i class="fa fa-power-off"></i> 退出</a></li>
                    </ul>
                </li>
            </ul>
            <!-- end header navigation right -->
        </div>
        <!-- end container-fluid -->
    </div>
    <!-- end #header -->
    <!-- begin #sidebar -->
    <div id="sidebar" class="sidebar">
        <!-- begin sidebar scrollbar -->
        <div data-scrollbar="true" data-height="100%">
            <!-- begin sidebar user -->
            <ul class="nav">
                <li class="nav-profile">
                    <div class="image">
                        <a href="javascript:;"><img src="artisan_img/user-12.jpg" alt="" /></a>
                    </div>
                    <div class="info">
                        <?php echo \think\Session::get('userinfo')['username']; ?>
                        <small>用户角色名</small>
                    </div>
                </li>
            </ul>
            <!-- end sidebar user -->
            <!-- begin sidebar nav -->
            <ul class="nav">
                <li class="has-sub">
                    <a href="<?php echo url('/admin/index/index'); ?>">
                        <i class="fa fa-laptop"></i>
                        <p>首页</p>
                    </a>
                </li>

                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-map-marker"></i>
                        <p>地图定位</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo url('/admin/location/location'); ?>">高德地图</a></li>
                        <li><a href="<?php echo url('admin/position/index'); ?>">百度地图api</a></li>
                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-align-left"></i>
                        <p>实时监测</p>
                    </a>
                    <ul class="sub-menu">
                        <li class="has-sub">
                            <a href="javascript:;">
                                <b class="caret pull-right"></b>
                                1分厂
                            </a>
                            <ul class="sub-menu">
                                <li class="has-sub">
                                    <a href="javascript:;">
                                        <b class="caret pull-right"></b>
                                        1车间
                                    </a>
                                    <ul class="sub-menu">
                                        <li><a href="<?php echo url('admin/coring/index'); ?>">1工段</a></li>
                                        <li><a href="javascript:;">2工段</a></li>
                                    </ul>
                                </li>
                                <li><a href="javascript:;">2车间</a></li>
                                <li><a href="javascript:;">3车间</a></li>
                            </ul>
                        </li>
                        <li><a href="javascript:;">2分厂</a></li>
                        <li><a href="javascript:;">3分厂</a></li>
                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-medkit"></i>
                        <p>报警响应</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo url('admin/Alarm/alarmAnswer'); ?>">报警信息记录</a></li>
                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-area-chart"></i>
                        <p>历史查询</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo url('/admin/History/query'); ?>">查询</a></li>
                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-user"></i>
                        <p>用户管理</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo url('admin/Index/showuser',['id' => \think\Session::get('userinfo')['id']]); ?>">当前用户信息</a></li>
                        <li><a href="<?php echo url('admin/Users/showuser'); ?>">所有用户</a></li>
                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-cogs"></i>
                        <p>系统管理</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo url('/admin/system/monitor_define'); ?>">测点定义</a></li>
                        <li><a href="<?php echo url('admin/alarm/alarmSetting'); ?>">报警设置</a></li>
                        <li><a href="<?php echo url('admin/rolers/showrole'); ?>">角色管理</a></li>
                        <li><a href="<?php echo url('admin/action/showact'); ?>">权限管理</a></li>

                    </ul>
                </li>
                <li class="has-sub">
                    <a href="javascript:;">
                        <b class="caret pull-right"></b>
                        <i class="fa fa-key"></i>
                        <p>系统说明</p>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="login.html">Login</a></li>
                        <li><a href="login_v2.html">Login v2</a></li>
                        <li><a href="login_v3.html">Login v3</a></li>
                        <li><a href="register_v3.html">Register v3</a></li>
                    </ul>
                </li>



                <!-- begin sidebar minify button -->
                <li><a href="javascript:;" class="sidebar-minify-btn" data-click="sidebar-minify"><i class="fa fa-angle-double-left"></i></a></li>
                <!-- end sidebar minify button -->
            </ul>
            <!-- end sidebar nav -->
        </div>
        <!-- end sidebar scrollbar -->
    </div>
    <div class="sidebar-bg"></div>
    <!-- end #sidebar -->
    <!-- begin #content -->
    
<div class="content">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a href="<?php echo url('Admin/Index/index'); ?>">首页</a></li>
        <li><a href="javascript:;">用户管理</a></li>
        <li class="active">所有用户</li>
    </ol>
    <!-- end breadcrumb -->
    <!-- begin page-header -->
    <h1 class="page-header">所有用户
        <small></small>
    </h1>
    <!-- end page-header -->
    <div class="col-md-12">
        <div class="panel panel-inverse" data-sortable-id="index-1">
            <div class="panel-heading">
                <div class="panel-heading-btn">
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i
                            class="fa fa-expand"></i></a>
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i
                            class="fa fa-repeat"></i></a>
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning"
                       data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger"
                       data-click="panel-remove"><i class="fa fa-times"></i></a>
                </div>
                <h3 class="panel-title">系统所有用户</h3>
            </div>
            <div class="alert alert-info fade in">
                <button type="button" class="close" data-dismiss="alert">
                    <span aria-hidden="true">&times;</span>
                </button>
                展示当前系统内所有的用户信息
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <!-- <div id="interactive-chart" class="height-sm"></div> -->
                    <table id="data-table" class="table table-striped table-bordered nowrap" width="100%">
                        <thead>
                        <tr>
                            <td>用户编号</td>
                            <td>用户名</td>
                            <td>用户邮箱</td>
                            <td>用户角色</td>
                            <td>当前状态</td>
                            <td>删除</td>
                            <td>操作</td>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(is_array($user) || $user instanceof \think\Collection || $user instanceof \think\Paginator): $i = 0; $__LIST__ = $user;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td><?php echo $v['id']; ?></td>
                            <td><?php echo $v['username']; ?></td>
                            <td><?php echo $v['email']; ?></td>
                            <?php if($v['user_type'] == '1'): ?>
                            <td><label class="label label-danger">超级管理员</label></td>
                            <?php elseif($v['user_type'] == '2'): ?>
                            <td><label class="label label-warning">车间负责</label></td>
                            <?php elseif($v['user_type'] == '3'): ?>
                            <td><label class="label label-success">工段负责</label></td>
                            <?php else: ?>
                            <td><label class="label label-info">电气室负责</label></td>
                            <?php endif; if($v['status'] == '1'): ?>
                            <td>
                                <label class="label label-success">正常</label></td>
                            <?php else: ?>
                            <td><label class="label label-danger">禁用</label></td>
                            <?php endif; ?>
                            <td>
                                <a href="#modal-dialog1" data-toggle="modal">
                                    <i class="fa fa-trash-o">删除</i> </a>
                                <!-- 删除 -->
                                <div class="modal fade" id="modal-dialog1">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"
                                                        aria-hidden="true">×
                                                </button>
                                                <h4 class="modal-title">警告</h4>
                                            </div>
                                            <div class="modal-body">
                                                <div class="alert alert-danger m-b-0">
                                                    <h4><i class="fa fa-info-circle"></i> 是否确认删除当前用户？</h4>
                                                </div>
                                            </div>
                                            <div class="modal-footer">
                                                <a href="javascript:;" class="btn btn-sm btn-white"
                                                   data-dismiss="modal">关闭</a>
                                                <a href="javascript:;" class="btn btn-sm btn-danger"
                                                   data-dismiss="modal">删除</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>

                            <?php if($v['status'] == '1'): ?>
                            <td>
                                <a href="<?php echo url('Admin/Users/userinfo',['id' => $v['id']]); ?>">
                                    <i class="fa fa-folder-open">查看</i></a> |
                                <a href="<?php echo url('Admin/Users/upuser',['id' => $v['id']]); ?>">
                                    <i class="fa fa-pencil">编辑</i></a> |
                                <a href="#modal-dialog" style="color:red;" class="email-btn text-danger" data-toggle="modal">
                                    <i class="fa fa-flag">禁用</i></a>
                                <!-- 禁用 -->
                                <div class="modal fade" id="modal-dialog">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"
                                                        aria-hidden="true">×
                                                </button>
                                                <h4 class="modal-title">警告</h4>
                                            </div>
                                            <div class="modal-body">
                                                <div class="alert alert-danger m-b-0">
                                                    <h4><i class="fa fa-info-circle"></i> 是否确认禁用当前用户？</h4>
                                                </div>
                                            </div>
                                            <div class="modal-footer">
                                                <a href="javascript:;" class="btn btn-sm btn-white"
                                                   data-dismiss="modal">关闭</a>
                                                <a href="<?php echo url('Admin/Users/forbiduser',['id' => $v['id']]); ?>"
                                                   class="btn btn-sm btn-danger">禁用</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                            </td>
                            <?php else: ?>
                            <td><a href="<?php echo url('Admin/Users/userinfo',['id' => $v['id']]); ?>"><i
                                    class="fa fa-folder-open">查看</i></a> | <a
                                    href="<?php echo url('Admin/Users/upuser',['id' => $v['id']]); ?>"><i
                                    class="fa fa-pencil">编辑</i></a> | <a href="#modal-dialog3" data-toggle="modal"><i
                                    class="fa fa-flag">启用</i></a>
                                <!-- 启用 -->
                                <div class="modal fade" id="modal-dialog3">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"
                                                        aria-hidden="true">×
                                                </button>
                                                <h4 class="modal-title">提示：</h4>
                                            </div>
                                            <div class="modal-body">
                                                是否确认启用当前用户？
                                            </div>
                                            <div class="modal-footer">
                                                <a href="javascript:;" class="btn btn-sm btn-white"
                                                   data-dismiss="modal">关闭</a>
                                                <a href="<?php echo url('Admin/Users/allowuser',['id' => $v['id']]); ?>"
                                                   class="btn btn-sm btn-danger">启用</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                            <?php endif; ?>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; ?>

                        </tbody>
                    </table>
                    <div class="col-md-9"></div>
                    <div class="col-md-3" style="margin:0px;padding: 0px;"><p class="pull-right"><?php echo $user->render(); ?></p>
                    </div>
                    <!-- #modal-dialog -->


                </div>
            </div>


        </div>

    </div>
</div>

    <!-- end #content -->
    <!-- begin theme-panel -->
    <div class="theme-panel">
        <a href="javascript:;" data-click="theme-panel-expand" class="theme-collapse-btn"><i class="fa fa-cog"></i></a>
        <div class="theme-panel-content">
            <h5 class="m-t-0">Color Theme</h5>
            <ul class="theme-list clearfix">
                <li class="active"><a href="javascript:;" class="bg-green" data-theme="default" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Default">&nbsp;</a></li>
                <li><a href="javascript:;" class="bg-red" data-theme="red" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Red">&nbsp;</a></li>
                <li><a href="javascript:;" class="bg-blue" data-theme="blue" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Blue">&nbsp;</a></li>
                <li><a href="javascript:;" class="bg-purple" data-theme="purple" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Purple">&nbsp;</a></li>
                <li><a href="javascript:;" class="bg-orange" data-theme="orange" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Orange">&nbsp;</a></li>
                <li><a href="javascript:;" class="bg-black" data-theme="black" data-click="theme-selector" data-toggle="tooltip" data-trigger="hover" data-container="body" data-title="Black">&nbsp;</a></li>
            </ul>
            <div class="divider"></div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label double-line">Header Styling</div>
                <div class="col-md-7">
                    <select name="header-styling" class="form-control input-sm">
                        <option value="1">default</option>
                        <option value="2">inverse</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label">Header</div>
                <div class="col-md-7">
                    <select name="header-fixed" class="form-control input-sm">
                        <option value="1">fixed</option>
                        <option value="2">default</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label double-line">Sidebar Styling</div>
                <div class="col-md-7">
                    <select name="sidebar-styling" class="form-control input-sm">
                        <option value="1">default</option>
                        <option value="2">grid</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label">Sidebar</div>
                <div class="col-md-7">
                    <select name="sidebar-fixed" class="form-control input-sm">
                        <option value="1">fixed</option>
                        <option value="2">default</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label double-line">Sidebar Gradient</div>
                <div class="col-md-7">
                    <select name="content-gradient" class="form-control input-sm">
                        <option value="1">disabled</option>
                        <option value="2">enabled</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-5 control-label double-line">Content Styling</div>
                <div class="col-md-7">
                    <select name="content-styling" class="form-control input-sm">
                        <option value="1">default</option>
                        <option value="2">black</option>
                    </select>
                </div>
            </div>
            <div class="row m-t-10">
                <div class="col-md-12">
                    <a href="#" class="btn btn-inverse btn-block btn-sm" data-click="reset-local-storage"><i class="fa fa-refresh m-r-3"></i> Reset Local Storage</a>
                </div>
            </div>
        </div>
    </div>
    <!-- end theme-panel -->
    <!-- begin scroll to top btn -->
    <a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
    <!-- end scroll to top btn -->
    <audio id="bgmusic">
        <source = src="/static/audio/4611.mp3" type="audio/mp3">
    </audio>
</div>
<!-- end page container -->
<!-- ================== BEGIN BASE JS ================== -->
<script src="artisan_plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="artisan_plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="artisan_plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="artisan_plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="assets/crossbrowserjs/html5shiv.js"></script>
<script src="assets/crossbrowserjs/respond.min.js"></script>
<script src="assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="artisan_plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="artisan_plugins/jquery-cookie/jquery.cookie.js"></script>
<script src="artisan_plugins/pace/pace.min.js"></script>
<!-- ================== END BASE JS ================== -->
<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="artisan_plugins/gritter/js/jquery.gritter.js"></script>
<script src="artisan_plugins/flot/jquery.flot.min.js"></script>
<script src="artisan_plugins/flot/jquery.flot.time.min.js"></script>
<script src="artisan_plugins/flot/jquery.flot.resize.min.js"></script>
<script src="artisan_plugins/flot/jquery.flot.pie.min.js"></script>
<script src="artisan_plugins/sparkline/jquery.sparkline.js"></script>
<script src="artisan_plugins/jquery-jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="artisan_plugins/jquery-jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="artisan_plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="artisan_js/apps.min.js"></script>
<script>
    $(document).ready(function () {
        App.init();
        //侧边栏active添加
        function sidebarActive() {
            if (window.location.pathname == '/admin/index/index.html') {
                $('li.has-sub').eq(0).addClass("active");
            }
            $('ul.sub-menu').each(function () {
                $(this).children().each(function () {
                    if ($(this).children().attr("href") == window.location.pathname) {
                        $(this).addClass("active");
                        $(this).parents('li').addClass("active");
                    }
                })
            });
        }
        sidebarActive();
        //侧边栏实时监测动态添加
        function sidebarAdd() {
            $.ajax({
                type:'post',
                url:'',
                data:{},
                success:function () {
                    
                }
            })
        }

        $(function () {
            // 定时刷新
            setTimeout(function () {
                    alltimedata();
                },
                200);//setTimeout 程序执行后200毫秒执行push，但是仅此一次。
            setInterval(function () {
                    alltimedata();
                },
                5000);
            // 利用ajax动态加载实时监测信息，实现定时及页面局部刷新
            function alltimedata() {
                $.ajax({
                    url: '/admin/coring/getdata',
                    data: {},
                    type: 'get',
                    datatype: 'json',
                    async: true,
                    success: function (data) {
                        var status = eval("(" + data + ")");
                        var isAlarm = 0;
                        for(var i=0; i<status.length;i++) {
                            // alert(status[i].status);
                            if(status[i].status == 2) {
                                isAlarm = 1;
                            }      
                        }
                            if(isAlarm == 1) {
                            var audio = document.getElementById("bgmusic");
                            audio.play();                                  
                            }

                    }
                });
            }
    });

    });
</script>



<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="artisan_plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="artisan_plugins/DataTables/js/dataTables.tableTools.js"></script>
<script src="artisan_js/table-manage-tabletools.demo.min.js"></script>
<script src="artisan_plugins/switchery/switchery.min.js"></script>
<script src="artisan_plugins/powerange/powerange.min.js"></script>
<script src="artisan_js/form-slider-switcher.demo.min.js"></script>
<script src="artisan_js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>
    $(document).ready(function () {
        TableManageTableTools.init();
    });
</script>

<!-- ================== END PAGE LEVEL JS ================== -->

